package com.zsummer.zero.jdk.string;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

import org.junit.Test;

public class Demo1 {

	@Test
	public void run1() throws UnsupportedEncodingException {
		String s = "癬";
		byte[] b1 = null;
		byte[] b2 = null;
		b1 = s.getBytes("GBK");
		b2 = s.getBytes("UTF8");
		System.out.println(Arrays.toString(b1));
		System.out.println(Arrays.toString(b2));
		for (byte b : b1) {
			System.out.print(Integer.toHexString(b) + " ");
		}
		System.out.println();
		for (byte b : b2) {
			System.out.print(Integer.toHexString(b) + " ");
		}
		System.out.println();
		byte[] bb = {-80, 95};
		System.out.println(new String(bb, "GBK"));
	}
	
	@Test
	public void run2() {
		String string = Integer.toHexString(80);
		System.out.println(string);
	}
}
